| Plant | Flowers | Date | lon | lat | ele | Month | Year | julian |
|---|---|---|---|---|---|---|---|---|
| Glossoloma oblongicalyx | 4 | 2015-10-19 | -78.59093 | 0.130838 | 2270 | October | 2015 | 292 |
| Gasteranthus quitensis | 2 | 2016-10-17 | -78.59770 | 0.120070 | 1940 | October | 2016 | 291 |
| Kohleria affinis | 1 | 2016-12-13 | -78.59534 | 0.126746 | 2110 | December | 2016 | 348 |
| Columnea ciliata | 3 | 2014-02-27 | -78.59934 | 0.116682 | 1960 | February | 2014 | 58 |
| Columnea medicinalis | 1 | 2014-04-23 | -78.59372 | 0.128700 | 2130 | April | 2014 | 113 |
| Drymonia teuscheri | 3 | 2016-07-28 | -78.59245 | 0.129393 | 2200 | July | 2016 | 210 |
| Plant | Flowers | Date | lon | lat | ele | Month | Year | julian |
|---|---|---|---|---|---|---|---|---|
| Glossoloma oblongicalyx | 4 | 2015-10-19 | -78.59093 | 0.130838 | 2270 | October | 2015 | 292 |
| Gasteranthus quitensis | 2 | 2016-10-17 | -78.59770 | 0.120070 | 1940 | October | 2016 | 291 |
| Kohleria affinis | 1 | 2016-12-13 | -78.59534 | 0.126746 | 2110 | December | 2016 | 348 |
| Columnea ciliata | 3 | 2014-02-27 | -78.59934 | 0.116682 | 1960 | February | 2014 | 58 |
| Columnea medicinalis | 1 | 2014-04-23 | -78.59372 | 0.128700 | 2130 | April | 2014 | 113 |
| Drymonia teuscheri | 3 | 2016-07-28 | -78.59245 | 0.129393 | 2200 | July | 2016 | 210 |
## sink("model/normal_julian.jags")
## cat("
## model {
##
## for (x in 1:Nobs){
##
## #observation
## Yobs[x] ~ dnorm(mu[Plant[x]],tau[Plant[x]])T(0,365)
##
## #Residuals
## residuals[x] <- Yobs[x] - mu[Plant[x]]
##
## #squared error
## sq[x]<-pow(residuals[x],2)
##
## #Assess Model Fit - squared residuals
## Ynew[x] ~ dnorm(mu[Plant[x]],tau[Plant[x]])T(0,365)
## sq.new[x]<-pow(Ynew[x] - mu[Plant[x]],2)
##
## }
##
## #Root mean squared residuals
## fit<-sqrt(sum(sq[])/Nobs)
## fitnew<-sqrt(sum(sq.new[])/Nobs)
##
## #Prediction
##
## for(i in 1:Npreds){
##
## #predict value
## prediction[i] ~ dnorm(mu[Ypred_plant[i]],tau[Ypred_plant[i]])T(0,365)
##
## #squared predictive error
## pred_error[i] <- pow(Ypred[i] - prediction[i],2)
## }
##
## #Root Mean Squared Predictive Error
## fitpred<-sqrt(sum(pred_error[])/Npreds)
##
## #Priors
##
## #Species level priors
##
## for (j in 1:Plants){
##
## #Intercept
## mu[j] ~ dnorm(0,0.0001)
##
## #variance
## sigma[j] ~ dunif(0,75)
## tau[j] <- pow(sigma[j], -2)
## }
##
## }
## ",fill=TRUE)
##
## sink()
## Compiling model graph
## Resolving undeclared variables
## Allocating nodes
## Graph information:
## Observed stochastic nodes: 7309
## Unobserved stochastic nodes: 8715
## Total graph size: 45223
##
## Initializing model
Red is the kernel density from the underlying data Black is the modeled phenology
## sink("model/normal_attraction.jags")
## cat("
## model {
##
## for (x in 1:Nobs){
##
## #observation
## mu[x] <- alpha + e[Plant[x]]
## Yobs[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
##
## #Residuals
## residuals[x] <- Yobs[x] - mu[x]
##
## #squared error
## sq[x]<-pow(residuals[x],2)
##
## #Assess Model Fit - squared residuals
## Ynew[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
## sq.new[x]<-pow(Ynew[x] - mu[x],2)
##
## }
##
## #Root mean squared error
## fit<-sqrt(sum(sq[])/Nobs)
## fitnew<-sqrt(sum(sq.new[])/Nobs)
##
## #autocorrelation in error
## e[1:Plants] ~ dmnorm(zeros[],tauC[,])
##
## ##covariance among similiar species
## for(i in 1:Plants){
## for(j in 1:Plants){
## C[i,j] = exp(-lambda * D[i,j])
## }
## }
##
## ## Covert variance to precision for each parameter
##
## iC=inverse(omega*C[,])
## tauC=iC
## tauC2=iC
##
## ###########
## #Prediction
## ###########
##
## for(i in 1:Npreds){
##
## #predict value
## prediction[i] ~ dnorm(mu[Ypred_plant[i]],tau[Ypred_plant[i]])T(0,365)
##
## #squared predictive error
## pred_error[i] <- pow(Ypred[i] - prediction[i],2)
## }
##
## #Root Mean Squared Predictive Error
## fitpred<-sqrt(sum(pred_error[])/Npreds)
##
## # Priors #
## ##########
##
## #Species level priors
##
## for (j in 1:Plants){
##
## #variance
## sigma[j] ~ dunif(0,75)
## tau[j] <- pow(sigma[j], -2)
## }
##
## #Intercept
## alpha ~ dnorm(0,0.0001)
##
## #Strength of covariance decay
## lambda ~ dunif(0,5)
##
## #Magnitude of the phylogenetic effect
## omega ~ dunif(0,20)
##
## }
## ",fill=TRUE)
##
## sink()
## Compiling model graph
## Resolving undeclared variables
## Allocating nodes
## Graph information:
## Observed stochastic nodes: 6991
## Unobserved stochastic nodes: 8286
## Total graph size: 43304
##
## Initializing model
Red is the kernel density from the underlying data Black is the model
## sink("model/normal_repulsion.jags")
## cat("
## model {
##
## for (x in 1:Nobs){
##
## #observation
## mu[x] <- alpha + e[Plant[x]]
## Yobs[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
##
## #Residuals
## residuals[x] <- Yobs[x] - mu[x]
##
## #squared error
## sq[x]<-pow(residuals[x],2)
##
## #Assess Model Fit - squared residuals
## Ynew[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
## sq.new[x]<-pow(Ynew[x] - mu[x],2)
##
## }
##
## #sum of squared error
## #Root mean squared error
## fit<-sqrt(sum(sq[])/Nobs)
## fitnew<-sqrt(sum(sq.new[])/Nobs)
##
## #autocorrelation in error
## e[1:Plants] ~ dmnorm(zeros[],tauC[,])
##
## ##covariance among similiar species
## for(i in 1:Plants){
## for(j in 1:Plants){
## C[i,j] = exp(-lambda * D[i,j])
## }
## }
##
## #Inverse matrix correlation for repulsion - see Ives and Helmus 2011
## #For clarity sake this is performed, even though it is undone by converting to precision
## iC=inverse(omega * C[,])
##
## ## Covert variance to precision for each parameter
##
## iiC=inverse(iC[,])
## tauC=iiC
## tauC2=iiC
##
## ###########
## #Prediction
## ###########
##
## for(i in 1:Npreds){
##
## #predict value
## prediction[i] ~ dnorm(mu[Ypred_plant[i]],tau[Ypred_plant[i]])T(0,365)
##
## #squared predictive error
## pred_error[i] <- pow(Ypred[i] - prediction[i],2)
## }
##
## #Root Mean Squared Predictive Error
## fitpred<-sqrt(sum(pred_error[])/Npreds)
##
## # Priors #
## ##########
##
## #Julian Intercept
## alpha ~ dnorm(0,0.0001)
##
## #Species level priors
##
## for (j in 1:Plants){
##
## #variance
## sigma[j] ~ dunif(0,75)
## tau[j] <- pow(sigma[j], -2)
## }
##
## #Strength of covariance decay
## lambda ~ dunif(0,5)
## omega ~ dunif(0,20)
## }
## ",fill=TRUE)
##
## sink()
## Compiling model graph
## Resolving undeclared variables
## Allocating nodes
## Graph information:
## Observed stochastic nodes: 6991
## Unobserved stochastic nodes: 8286
## Total graph size: 43305
##
## Initializing model
Red is the kernel density from the underlying data Black is the model
## sink("model/normal_attraction.jags")
## cat("
## model {
##
## for (x in 1:Nobs){
##
## #observation
## mu[x] <- alpha + e[Plant[x]]
## Yobs[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
##
## #Residuals
## residuals[x] <- Yobs[x] - mu[x]
##
## #squared error
## sq[x]<-pow(residuals[x],2)
##
## #Assess Model Fit - squared residuals
## Ynew[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
## sq.new[x]<-pow(Ynew[x] - mu[x],2)
##
## }
##
## #Root mean squared error
## fit<-sqrt(sum(sq[])/Nobs)
## fitnew<-sqrt(sum(sq.new[])/Nobs)
##
## #autocorrelation in error
## e[1:Plants] ~ dmnorm(zeros[],tauC[,])
##
## ##covariance among similiar species
## for(i in 1:Plants){
## for(j in 1:Plants){
## C[i,j] = exp(-lambda * D[i,j])
## }
## }
##
## ## Covert variance to precision for each parameter
##
## iC=inverse(omega*C[,])
## tauC=iC
## tauC2=iC
##
## ###########
## #Prediction
## ###########
##
## for(i in 1:Npreds){
##
## #predict value
## prediction[i] ~ dnorm(mu[Ypred_plant[i]],tau[Ypred_plant[i]])T(0,365)
##
## #squared predictive error
## pred_error[i] <- pow(Ypred[i] - prediction[i],2)
## }
##
## #Root Mean Squared Predictive Error
## fitpred<-sqrt(sum(pred_error[])/Npreds)
##
## # Priors #
## ##########
##
## #Species level priors
##
## for (j in 1:Plants){
##
## #variance
## sigma[j] ~ dunif(0,75)
## tau[j] <- pow(sigma[j], -2)
## }
##
## #Intercept
## alpha ~ dnorm(0,0.0001)
##
## #Strength of covariance decay
## lambda ~ dunif(0,5)
##
## #Magnitude of the phylogenetic effect
## omega ~ dunif(0,20)
##
## }
## ",fill=TRUE)
##
## sink()
## Compiling model graph
## Resolving undeclared variables
## Allocating nodes
## Graph information:
## Observed stochastic nodes: 7302
## Unobserved stochastic nodes: 8692
## Total graph size: 45641
##
## Initializing model
Red is the kernel density from the underlying data Black is the model
## sink("model/normal_repulsion.jags")
## cat("
## model {
##
## for (x in 1:Nobs){
##
## #observation
## mu[x] <- alpha + e[Plant[x]]
## Yobs[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
##
## #Residuals
## residuals[x] <- Yobs[x] - mu[x]
##
## #squared error
## sq[x]<-pow(residuals[x],2)
##
## #Assess Model Fit - squared residuals
## Ynew[x] ~ dnorm(mu[x],tau[Plant[x]])T(0,365)
## sq.new[x]<-pow(Ynew[x] - mu[x],2)
##
## }
##
## #sum of squared error
## #Root mean squared error
## fit<-sqrt(sum(sq[])/Nobs)
## fitnew<-sqrt(sum(sq.new[])/Nobs)
##
## #autocorrelation in error
## e[1:Plants] ~ dmnorm(zeros[],tauC[,])
##
## ##covariance among similiar species
## for(i in 1:Plants){
## for(j in 1:Plants){
## C[i,j] = exp(-lambda * D[i,j])
## }
## }
##
## #Inverse matrix correlation for repulsion - see Ives and Helmus 2011
## #For clarity sake this is performed, even though it is undone by converting to precision
## iC=inverse(omega * C[,])
##
## ## Covert variance to precision for each parameter
##
## iiC=inverse(iC[,])
## tauC=iiC
## tauC2=iiC
##
## ###########
## #Prediction
## ###########
##
## for(i in 1:Npreds){
##
## #predict value
## prediction[i] ~ dnorm(mu[Ypred_plant[i]],tau[Ypred_plant[i]])T(0,365)
##
## #squared predictive error
## pred_error[i] <- pow(Ypred[i] - prediction[i],2)
## }
##
## #Root Mean Squared Predictive Error
## fitpred<-sqrt(sum(pred_error[])/Npreds)
##
## # Priors #
## ##########
##
## #Julian Intercept
## alpha ~ dnorm(0,0.0001)
##
## #Species level priors
##
## for (j in 1:Plants){
##
## #variance
## sigma[j] ~ dunif(0,75)
## tau[j] <- pow(sigma[j], -2)
## }
##
## #Strength of covariance decay
## lambda ~ dunif(0,5)
## omega ~ dunif(0,20)
## }
## ",fill=TRUE)
##
## sink()
## Compiling model graph
## Resolving undeclared variables
## Allocating nodes
## Graph information:
## Observed stochastic nodes: 7302
## Unobserved stochastic nodes: 8692
## Total graph size: 45642
##
## Initializing model
Red is the kernel density from the underlying data Black is the model
## # A tibble: 5 x 2
## Model p
## <chr> <dbl>
## 1 julian 0
## 2 phylogenetic_attraction 0
## 3 phylogenetic_repulsion 0
## 4 trait_attraction 0
## 5 trait_repulsion 0